Ensure Edge Plugin for API endpoint is only loaded on API-Server and AF2 Webserver#52952
Merged
jscheffl merged 3 commits intoapache:mainfrom Jul 18, 2025
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ensures the Edge plugin’s API endpoint only loads on the intended Airflow components (API server in Airflow 3.x or webserver in Airflow 2.x) by detecting the runtime context and gating the endpoint registration.
- Imports
sysand addsRUNNING_ON_APISERVERflag based onsys.argv - Guards the plugin’s API endpoint registration with
RUNNING_ON_APISERVER - Maintains existing behavior for older Airflow releases
Comments suppressed due to low confidence (1)
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py:218
- There are no tests covering the new
RUNNING_ON_APISERVERlogic. Adding unit tests to simulate differentsys.argvvalues would ensure the endpoint only loads under the correct conditions.
if AIRFLOW_V_3_0_PLUS:
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py
Show resolved
Hide resolved
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py
Show resolved
Hide resolved
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py
Show resolved
Hide resolved
8991756 to
787465e
Compare
787465e to
67791b7
Compare
karenbraganz
pushed a commit
to karenbraganz/airflow
that referenced
this pull request
Jul 18, 2025
…AF2 Webserver (apache#52952) * Ensure Edge Plugin for API endpoint is only loaded on API-Server and AF2 Webserver * Fix and extend pytests for edge3 plugin * Add a note to clean bad init code up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes: #52922
I have noticed during providers release testing July 2025 that API endpoint is started also on TaskSDK task runner and other components. But the API plugin endpoint should only be loaded and be active on API server on Airflow 3 and Webserver is running on Airflow 2.
Unfortuantely in plugins_manager there is currently no concept in detecting this, while this needs to be created a secondary check is added to check on which component the plugin is loaded.
Negative side effect: If you run
AIRFLOW__CORE__EXECUTOR=airflow.providers.edge3.executors.edge_executor.EdgeExecutor airflow plugins -o yamlthen the plugin is listed but is not providing the details of the endpoint. This is only provided on API server and webserver now.